#include <iostream>
#include <string>
#include <set>
#include <map>
#include <stdio.h>
#include <boost/shared_ptr.hpp>

using namespace std;
using namespace boost;

string getString()
{
	char buf[32];
	snprintf(buf, 32, "%s", "hello");
	return buf;
}

int main()
{
//	string str = getString();
//	cout << str;
	set< shared_ptr<string> > strs;
	shared_ptr<string> str1(new string("hello!"));
	shared_ptr<string> str2(new string("hello2!"));
	strs.insert(str1);
	strs.insert(str2);

	set< shared_ptr<string> >::iterator it = strs.find(str2);
	cout << (*it)->c_str() << endl;

	shared_ptr<string> pstr = str1;
	cout << "pstr == str1 :";
	cout << (pstr == str1 ? "true" : "false") << endl;
	cout << "pstr == str2 :";
	cout << (pstr == str2 ? "true" : "false") << endl;


	string hello = getString();
	cout << hello << endl;
	

	map<int, shared_ptr<string> > strings;
	shared_ptr<string> s = strings[0];
	cout << ( s == NULL ? "IS NULL":"OTHER") << endl;
}
